<?=$this->load->view('include_header',null)?>
	<div id="top-panel">
		<div id="panel">
			<ul>
				<li class="current"><a href="<?=site_url('archive/idcard/'.$id)?>" class="report"><?=(empty($id))?"录入新":"编辑"?>客户基本信息</a></li>
				<?php if(!empty($info->id)):?><li><a id="printInfo" class="folder_table">打印本页信息</a></li><?php endif;?>
			</ul>
		</div>
	</div>
	<div id="wrapper">
		<div id="content">
			<div id="box">
<!-- table begin -->
<form method="post" id="form"  enctype="multipart/form-data" action="<?=site_url('schengen/kr_update/'.$cateid)?>">

	<h3>韩国申请表</h3>
    <table width="100%">
    <thead>
        <tr>
          <td colspan="4" align="right"><img src="<?= (@$info->avatar)?@$info->avatar:'images/avatar.gif'?>" width="150" height="150" /></td>
		  <td align="right">
		  上传照片<br />
		  <input type="file" name="userphoto" /><br />
		  (.gif|.jpg|.png文件,最大1M)<br />
		  <?php if (@$info->attachment):?><a href="<?= @$info->attachment?>" target="_blank">点击下载附件</a><?php endif; ?>
		  &nbsp;&nbsp;&nbsp;&nbsp;上传附件<br />
		  <input type="file" name="userfile" /><br />
		  (.pdf|.zip|.rar|.doc,最大2M)		  </td>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <td colspan="5" align="right">			
			<input type="hidden" name="id" value="<?=$id?>" />
			<input id="button1" type="submit" value="提交信息" />
			<input id="button2" type="reset" value="重置" />			</td>
        </tr>
    </tfoot>

    <tbody>
        <tr class="odd">
            <td>1.姓(拼音) Surname</td>
            <td><input type="text" name="surname" value="<?= @$info->surname?>" /></td>
            <td>&nbsp;</td>
            <td>2.名(拼音) Given  Names</td>
            <td><input type="text" name="firstname" value="<?= @$info->firstname?>" /></td>
        </tr>
        <tr class="even">
            <td>3.汉字姓名</td>
            <td><input type="text" name="name" value="<?= @$info->name?>" /></td>
            <td>&nbsp;</td>
            <td>4.性别 Gender</td>
            <td><input type="radio" name="sex" value="1" <?= (@$info->sex==1)?'checked':''?> />
              M
                <input type="radio" name="sex" value="2" <?= (@$info->sex==2)?'checked':''?> />
              F</td>
        </tr>
        <tr class="odd">
            <td>5.出生日期 Date of Birth</td>
            <td><input type="text" name="birth" value="<?= @$info->birth?>" id="birth" /></td>
            <td>&nbsp;</td>
            <td>6.国籍 Nationality </td>
            <td><input type="text" name="nationality" value="<?= @$info->nationality?>" /></td>
        </tr>
        <tr class="even">
            <td>7.出生地点 Country of Birth</td>
            <td><input type="text" name="birth_place" value="<?= @$info->birth_place?>" /></td>
            <td>&nbsp;</td>
            <td>8.现住所 Home Address</td>
            <td><input name="home_address" type="text" value="<?= @$info->home_address?>" /></td>
        </tr>
        <tr class="odd">
            <td>9.固定电话号码 Phone NO.</td>
            <td><input type="text" name="tel" value="<?= @$info->tel?>" /></td>
            <td>&nbsp;</td>
            <td>10.手机号码 Cell Phone</td>
            <td><input name="mobile" type="text" value="<?= @$info->mobile?>" /></td>
        </tr>
        <tr class="even">
          <td>11.电子邮箱 E-mail</td>
            <td><input type="text" name="email" value="<?= @$info->email?>" id="email" /></td>
            <td>&nbsp;</td>
            <td>12.身份证号 National Identity Number</td>
            <td><input name="national_id" type="text" value="<?= @$info->national_id?>" /></td>
        </tr>
		<tr class="odd">
		<td colspan="5"><strong>护照Passport</strong></td>
		</tr>
        <tr class="even">
            <td>13.护照号码 Passport NO.</td>
            <td><input type="text" name="travel_document_num" value="<?= @$info->travel_document_num?>" /></td>
            <td>&nbsp;</td>
            <td>14.护照类型 Classification</td>
            <td>
<input type="radio" name="travel_document_type" value="1" <?= (@$info->travel_document_type==1)?'checked':''?> />外交
<input type="radio" name="travel_document_type" value="2" <?= (@$info->travel_document_type==2)?'checked':''?> />公务
<input type="radio" name="travel_document_type" value="3" <?= (@$info->travel_document_type==3)?'checked':''?> />公务普通 <br />
<input type="radio" name="travel_document_type" value="4" <?= (@$info->travel_document_type==4)?'checked':''?> />因私
<input type="radio" name="travel_document_type" value="5" <?= (@$info->travel_document_type==5)?'checked':''?> />其他</td>
        </tr>
        <tr class="odd">
            <td>15.签发地点 Place of Issue</td>
            <td><input type="text" name="travel_document_issue_by" value="<?= @$info->travel_document_issue_by?>" /></td>
            <td>&nbsp;</td>
            <td>16.签发日期 Date of Issue</td>
            <td><input name="travel_document_issue_date" type="text" value="<?= @$info->travel_document_issue_date?>" id="travel_document_issue_date" /></td>
        </tr>
        <tr class="even">
            <td>17.有效期至 Date Of Expiry</td>
            <td><input type="text" name="travel_document_valid_date" value="<?= @$info->travel_document_valid_date?>" id="travel_document_valid_date" /></td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
        </tr>
		<tr class="odd">
		<td colspan="5"><strong>职业</strong></td>
		</tr>
        <tr class="even">
            <td>18.职业 Occupation</td>
            <td><input type="text" name="occupation" value="<?= @$info->occupation?>" /></td>
            <td>&nbsp;</td>
            <td>19.单位电话 Business Phone NO.</td>
            <td><input type="text" name="business_tel" value="<?= @$info->business_tel?>"/></td>
        </tr>
		        <tr class="odd">
            <td colspan="5">20.单位名称  Name of Present Employer <input name="business_name" type="text" value="<?= @$info->business_name?>" style="width:500px" />
              <br/>
       单位地址  Address of Present Employer
   <input name="business_address" type="text" value="<?= @$info->business_address?>" style="width:500px" /></td>
        </tr>
        <tr class="even">
            <td colspan="5"><strong>婚姻状况</strong></td>
        </tr>		
        <tr class="odd">
            <td>21.婚姻状况</td>
            <td>
			<input type="radio" name="marital_status" value="1" <?= (@$info->marital_status==1)?'checked':''?>/>未婚 Single 
			<input type="radio" name="marital_status" value="2" <?= (@$info->marital_status==2)?'checked':''?>/>已婚 Married<br />		
            <input type="radio" name="marital_status" value="3" <?= (@$info->marital_status==3)?'checked':''?>/>丧偶 Widowed 
            <input type="radio" name="marital_status" value="4" <?= (@$info->marital_status==4)?'checked':''?>/>离婚 Divorced</td>
			<td>&nbsp;</td>
			<td>22.配偶者姓名 Spouse's Name</td>
			<td><input type="text" name="spouse_name" value="<?= @$info->spouse_name?>"/></td>
        </tr>
        <tr class="even">
            <td>23.配偶者出生日期 Spouse's Date of Birth</td>
            <td><input type="text" name="spouse_birth" value="<?= @$info->spouse_birth?>" id="spouse_birth"/></td>
            <td>&nbsp;</td>
            <td>24.配偶者国籍 Spouse's Nationality</td>
            <td><input type="text" name="spouse_nationality" value="<?= @$info->spouse_nationality?>"/></td>
        </tr>
        <tr class="odd">
            <td>25.配偶者联系电话 Spouse's TEL</td>
			<td><input type="text" name="spouse_tel" value="<?= @$info->spouse_tel?>"/></td>
			<td>&nbsp;</td>
			<td></td>
			<td></td>
        </tr>
        <tr class="even">
            <td>26.赴韩目的 Purpose of Entry</td>
            <td><input name="purpose" type="text" value="<?= @$info->purpose?>" /></td>
			<td>&nbsp;</td>
			<td>27.在韩停留时间 Potential Length of Stay</td>
			<td><input name="stay_length" type="text" value="<?= @$info->stay_length?>" /></td>
        </tr>

        <tr class="odd">
            <td>28.预定赴韩日期 Potential Date of Entry</td>
            <td><input type="text" name="arrival_date" value="<?= @$info->arrival_date?>" id="arrival_date" /></td>
            <td>&nbsp;</td>
            <td>29.过去有无访韩经历 Previous Visit (If Any)</td>
            <td><input type="radio" name="has_visit" value="1" <?= (@$info->has_visit==1)?'checked':''?>/> 有
&nbsp;&nbsp;<input type="radio" name="has_visit" value="0" <?= (@$info->has_visit==0)?'checked':''?>/> 无</td>
        </tr>
        <tr class="even">
            <td>30.韩国内停留地 Address in Korea</td>
            <td><input type="text" name="korea_address" value="<?= @$info->korea_address?>" /></td>
            <td>&nbsp;</td>
            <td>31.韩国内联系电话 Phone NO. in Korea</td>
            <td><input type="text" name="korea_tel" value="<?= @$info->korea_tel?>" /></td>
        </tr>
        <tr class="odd">
            <td>32.此次赴韩费用支付者 Who Will Pay For The Expense For Your Stay?</td>
            <td colspan="4"><input name="expense" type="text" value="<?= @$info->expense?>" style="width:500px" /></td>
        </tr>
        <tr class="even">
            <td>33.最近5年内旅行过的国家 Countries You Have Traveled During The Past 5 Years</td>
            <td colspan="4"><input name="traveled_country" type="text" value="<?= @$info->traveled_country?>" style="width:500px" /></td>
        </tr>
        <tr class="odd">
            <td colspan="5">34.  同伴家族Accompanying Family<br/>
		  关系 Relationship	
		  <input name="relatives1_rel" type="text" value="<?= @$info->relatives1_rel?>" style="width:50px" /> 
		  国籍 Nationality	
		  <input name="relatives1_nationality" type="text" value="<?= @$info->relatives1_nationality?>" style="width:50px" /> 
		  姓名 Name	
		  <input name="relatives1_name" type="text" value="<?= @$info->relatives1_name?>" style="width:80px" />
		  出生日期 Date of Birth	
		  <input name="relatives1_birth" type="text" value="<?= @$info->relatives1_birth?>" id="relatives1_birth" style="width:80px" />
		  性别 Gender 
		  <input name="relatives1_sex" type="text" value="<?= @$info->relatives1_sex?>" style="width:50px"/>
			  <br />
		  关系 Relationship	
		  <input name="relatives2_rel" type="text" value="<?= @$info->relatives2_rel?>" style="width:50px" /> 
		  国籍 Nationality	
		  <input name="relatives2_nationality" type="text" value="<?= @$info->relatives2_nationality?>" style="width:50px" /> 
		  姓名 Name	
		  <input name="relatives2_name" type="text" value="<?= @$info->relatives2_name?>" style="width:80px" />
		  出生日期 Date of Birth	
		  <input name="relatives2_birth" type="text" value="<?= @$info->relatives2_birth?>" id="relatives2_birth" style="width:80px" />
		  性别 Gender 
		  <input name="relatives2_sex" type="text" value="<?= @$info->relatives2_sex?>" style="width:50px"/></td>
        </tr>
        <tr class="even">
            <td colspan="5"><br />
              35. 韩国内担保人Guarantor or Reference in Korea<br/>
		  关系 Relationship	
		  <input name="guarantor_rel" type="text" value="<?= @$info->guarantor_rel?>" style="width:50px" /> 
		  国籍 Nationality	
		  <input name="guarantor_nationality" type="text" value="<?= @$info->guarantor_nationality?>" style="width:50px" /> 
		  姓名 Name	
		  <input name="guarantor_name" type="text" value="<?= @$info->guarantor_name?>" style="width:80px" />
		  出生日期 Date of Birth	
		  <input name="guarantor_birth" type="text" value="<?= @$info->guarantor_birth?>" id="guarantor_birth" style="width:80px" />
		  性别 Gender 
		  <input name="guarantor_sex" type="text" value="<?= @$info->guarantor_sex?>" style="width:50px"/></td>
        </tr>
        <tr class="odd">
            <td colspan="5">I declare that the statements made in this application are true and correct to the best of my knowledge and belief, that I will observe the provisions of the Immigration Law of the Republic of Korea and that I will not engage in any activities irrelevant to the purpose of entry stated herein. Besides, I am fully aware that any false or misleading statement may result in the refusal of a visa, and that possession of a visa does not entitle the bearer to enter the Republic of Korea upon arrival at the port of entry if he/she is found inadmissible.</td>
        </tr>
        
    </tbody>
	</table>
<!-- table end -->
</form>

			</div>
		</div>
		
		<?=$this->load->view('include_sidebar',array('id'=>$id,'forms'=>$forms))?>
	</div>

<script type="text/javascript">
$().ready(function() {
  $("#form").validate({
    rules: {
		surname:"required",
		firstname:"required",
		name:"required",
		sex:"required",
		birth:"required",
		nationality:"required",
		national_id:"required",
		travel_document_num:"required",
		travel_document_type:"required",
		travel_document_issue_by:"required",
		travel_document_issue_date:"required",
		travel_document_valid_date:"required",
		marital_status:"required"
    }
  });
  
	$.datepicker.setDefaults(
		{
		dateFormat: 'yy/mm/dd',
		changeMonth: true,
		changeYear: true,
		showOn: "both",
		buttonImage: "images/calendar.gif",
		buttonImageOnly: true
		}
	);

	$("#birth").datepicker();
	$("#travel_document_issue_date").datepicker();
	$("#travel_document_valid_date").datepicker();
	$("#spouse_birth").datepicker();
	$("#arrival_date").datepicker();
	$("#relatives1_birth").datepicker();
	$("#relatives2_birth").datepicker();
	$("#guarantor_birth").datepicker();
	
	$("#email").autoMail();

	$("#printInfo").click(function(o) {
		var prints = [
			{rel_id: <?=$cateid?>, rec_id: <?=$id?>}
		]  ;
		
		var jdata = JSON.stringify(prints);
		//alert(jdata);
		$.post("<?=site_url('proxy/does/'.str_replace('==','',base64_encode('http://'.$_SERVER['SERVER_NAME'].':9090/javaprduct/servlet/test')))?>",{clients:jdata},function(msg){alert(msg)});
	});
	
	$("#printInfo").ajaxError(function(event,request, settings){
		//$(this).append("<li>出错页面:" + settings.url + "</li>");
		alert("无法访问"+ settings.url );
	}); 
 
});
</script>

<?=$this->load->view('include_footer',null)?>